package com.xdtech.trans.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.xdtech.core.model.BaseModel;

/**
 * 
 * @author max.zheng
 * @create 2015-06-06 17:37:49
 * @since 1.0
 * @see 
 */
@Entity
@Table(name="TRANS_ACCOUNT")
public class TransAccount extends BaseModel implements Serializable{
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	@Column(name="ACCOUNT_NAME")
	private String accountName;
	@Column(name="ACCOUNT_TYPE")
	private String accountType;
	@Column(name="OPEN_DATE")
	private String openDate;
	@Column(name="ACCOUNT_BALANCE")
	private Double accountBalance;
	@Column(name="WARN_BALANCE")
	private Double warnBalance;
	@Column(name="STOP_BALANCE")
	private Double stopBalance;
	@Column(name="REMARK")
	private String remark;
	@Column(name="CONTACT")
	private String contact;
	@Column(name="CONTACT_PHONE")
	private String contactPhone;
	
	@ManyToOne
	@JoinColumn(name = "WEBSITE_ID")
	private TransWebSite transWebSite;
	
	@OneToMany(mappedBy="transAccount",orphanRemoval=true,fetch=FetchType.LAZY) 
	private List<TransAccountTrade> transAccountTrades = new ArrayList<TransAccountTrade>(); 

	public TransAccount setId(Long id) {
		this.id = id;
		return this;
	}
	public Long getId() {
		return id;
	}
	public void setAccountType(String accountType) {
		this.accountType = accountType;
	}
	public String getAccountType() {
		return accountType;
	}
	public void setOpenDate(String openDate) {
		this.openDate = openDate;
	}
	public String getOpenDate() {
		return openDate;
	}
	public void setAccountBalance(Double accountBalance) {
		this.accountBalance = accountBalance;
	}
	public Double getAccountBalance() {
		return accountBalance;
	}
	public void setWarnBalance(Double warnBalance) {
		this.warnBalance = warnBalance;
	}
	public Double getWarnBalance() {
		return warnBalance;
	}
	public void setStopBalance(Double stopBalance) {
		this.stopBalance = stopBalance;
	}
	public Double getStopBalance() {
		return stopBalance;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getRemark() {
		return remark;
	}
	public void setContact(String contact) {
		this.contact = contact;
	}
	public String getContact() {
		return contact;
	}
	public void setContactPhone(String contactPhone) {
		this.contactPhone = contactPhone;
	}
	public String getContactPhone() {
		return contactPhone;
	}
	public TransWebSite getTransWebSite() {
		return transWebSite;
	}
	public void setTransWebSite(TransWebSite transWebSite) {
		this.transWebSite = transWebSite;
	}
	public String getAccountName() {
		return accountName;
	}
	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}
	public List<TransAccountTrade> getTransAccountTrades() {
		return transAccountTrades;
	}
	public void setTransAccountTrades(List<TransAccountTrade> transAccountTrades) {
		this.transAccountTrades = transAccountTrades;
	}
	
	
	
}
